<ix-table-expandable-row [data]="getDetails(user())">
  @if (user().local) {
    <button
      mat-button
      [ixTest]="['edit', user().username]"
      (click)="doEdit(user())"
    >
      <ix-icon name="edit"></ix-icon>
      <span>{{ 'Edit' | translate }}</span>
    </button>
  }

  <ng-container *ixRequiresRoles="[Role.AccountWrite]">
    @if (!user().immutable && loggedInUser()?.pw_name !== user().username) {
      <button
        mat-button
        [ixTest]="['delete', user().username]"
        (click)="doDelete(user())"
      >
        <ix-icon name="mdi-delete"></ix-icon>
        <span>{{ 'Delete' | translate }}</span>
      </button>
    }
  </ng-container>

  <button
    mat-button
    [ixTest]="['logs', user().username]"
    (click)="viewLogs(user())"
  >
    <ix-icon name="receipt_long"></ix-icon>
    <span>{{ 'Audit Logs' | translate }}</span>
  </button>

  @if (loggedInUser()?.pw_name !== user().username && isStigMode()) {
    <button
      *ixRequiresRoles="[Role.AccountWrite]"
      mat-button
      [ixTest]="['generate-one-time-password', user().username]"
      (click)="generateOneTimePassword(user())"
    >
      <ix-icon name="password"></ix-icon>
      <span>{{ 'Generate One-Time Password' | translate }}</span>
    </button>
  }
</ix-table-expandable-row>
